

	
	
	



 <style>
     .red{ margin-top: 5px;}
 </style>



    <div class="fbneirong">


        <form class="am-form">
            <div class="am-form-group am-cf">
                <div class="zuo">确认兑换金额：</div>
                <div class="you">
                    <input type="text" class="am-input-sm" id="doc-ipt-email-1"   maxlength="7" name="money" placeholder="请输入金额">
                    <div class="red">
                        0.9元兑换1金币 。本金不用兑换，佣金兑换成金币！！！
                    </div>
                </div>

            </div>

            <div class="am-form-group am-cf">
                <div class="zuo">可得金币数：</div>
                <div class="you">
                    <input type="text"   name="gold" class="am-input-sm red"  disabled  id="doc-ipt-email-1" value="" >
                </div>
            </div>

            <div class="am-form-group am-cf">
                <div class="you" style="margin-left: 11%;">
                &nbsp; <div    id="chongzhi" class="am-btn am-btn-secondary am-radius">确认兑换</div>

                </div>
            </div>
        </form>



    </div>

    </div>
    </div>
    </div>

    <div class="foods">
        <ul>
            版权所有@2019.
        </ul>
        <dl>
            <a href="" title="返回头部" class="am-icon-btn am-icon-arrow-up"></a>
        </dl>
    </div>
    </body>
    </html>
    




    <script>
        var on_request=false;
        var page=1;
       $("input[name='money']").change(function () {
           var money = $("input[name='money']").val();
           var gold=money*10/9;
           gold=gold.toFixed(2);

           $("input[name='gold']").val(gold);
       });
        $("#chongzhi").click(function () {
            pay()
        });
        function pay() {
            if (on_request) {
                return;
            }
            var url = "<?php echo base_url(); ?>/Business/getgoldaction";
            var postdata = {
            };
            var money = $("input[name='money']").val();
            if(money==""){
                layer.msg('请输入金额',{icon: 5,time:800} ) ;
                $("input[name='money']").focus();
                return;
            }
            checknum(money,'money');
            postdata['money'] =money;
            on_request = true;
            $.post(url, postdata, function (data) {
                on_request = false;
                if(data.code==0){
                    layer.msg('兑换成功',{icon: 1,time:800},function () {
                        window.location.href="<?php echo base_url() ?>"+'/business/paylog' ;
                    });
                }else{
                    layer.msg(data.msg,{icon: 7,time:1000});
                }

            },"json");
        }
    </script>
	



 
 
 
 
